< previous page page_663 next page >

Page 663
14. Set the DragIcon and the Picture properties to the Phone01.ico file located in the examples folder for this chapter.
15. Add another image control directly underneath the phone image control.
16. Set the Name property to imaDisk.
17. Set the DragMode property to 1 - Automatic.
18. Set the Tag property to Disk.
19. Set the DragIcon and the Picture properties to the Disk06.ico file located in the examples folder for this chapter.
20. Add another image control directly underneath the disk image control.
22. Set the Name property to imaFlag.
22. Set the DragMode property to 1 - Automatic.
23. Set the Tag property to Flag.
24. Set the DragIcon and the Picture properties to the flgusa02.ico file located in the examples folder for this chapter.
25. Be sure to set the Start Up Object option in the Project, Properties menu to this new form.
analysis.gifYou set the Tag property of each of the image controls so that you can use these strings when you drop the controls onto the list box. You grab the Tag propertys value in the DragDrop event of the list box. Tag is not used by Visual Basic, so you can use it for things like this.

EXERCISE
Checking the DragDrop for a Valid Control
1. Double-click the list box.
2. Select the DragDrop event from the Procedures combo box.
3. Add the following code to the event:
Sub lstThings_DragDrop (Source As Control, X As Single, _
Y As Single)
If TypeOf Source Is Image Then
lstThings.AddItem Source.Tag
End If
End Sub

 
< previous page page_663 next page >

If you like this book, buy it!